/*
File:					DLLMAIN.C

Date Written:	August 1996

Author:				John Duminy

Description:	Tele-Connect utility DLL main module.
							
History:							
*/
/////////////////////////////////////////////////////////////////////////////////////
#include <windows.h>

HANDLE GetHInst(void);

#ifdef _WIN32
char szModule[] = "TCUTIL32.DLL";
HANDLE ghModule = NULL;
#else
char szModule[] = "TCUTIL.DLL";
#endif

#ifdef _WIN32

BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
	switch(dwReason) 
	{
		case DLL_PROCESS_ATTACH:
			ghModule = hModule;
			break;
	}
	return TRUE;
}

#else

int FAR PASCAL LibMain(hInst, DataSeg, HeapSize, lpCmdLine)
HANDLE hInst;       
WORD   DataSeg;     
WORD   HeapSize;    
LPSTR lpCmdLine;    
{
  	if (HeapSize > 0)
    	UnlockData (0) ;
	
  	return 1 ;
}

int FAR PASCAL WEP(int nParam)
{                        
   	return 1;
}

#endif

HANDLE GetHInst()
{
#ifdef _WIN32
	return ghModule;
#else
	static HANDLE hInst = NULL;
	if (hInst == NULL)
		hInst = (HANDLE)GetModuleHandle((LPSTR)szModule);
  return hInst;
#endif
}